/**
 * 
 */
package com.feizhi.common.stream;

import java.io.Closeable;
import java.io.IOException;

import org.apache.commons.logging.Log;

/**
 * @author shuaqiu 2013年11月17日
 *
 */
public class StreamUtil {

	public static void close(Closeable closeable) {
		if (closeable != null) {
			try {
				closeable.close();
			} catch (IOException e) {
			}
		}
	}

	public static void close(Closeable closeable, Log log) {
		if (closeable != null) {
			try {
				closeable.close();
			} catch (IOException e) {
				if (log.isErrorEnabled()) {
					log.error(e.getMessage(), e);
				}
			}
		}
	}
}
